package boss.portal.service.impl;

import boss.portal.entity.Charge;
import boss.portal.param.PowerOnRequest;
import boss.portal.repository.ChargeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;

@Service
public class ChargeServiceImpl {

    @Autowired
    WebClientService webClientService;

    @Autowired
    ChargeRepository chargeRepository;


    public Flux<String> doPowerOn(PowerOnRequest request, String deviceNo) {
        //保存数据库记录
        Charge charge = new Charge();

        chargeRepository.save(charge);
        return webClientService.doPowerOn(request, deviceNo);
    }
}
